Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- comment style



  20 bit operations programmers should know

While talking about bit operation, programmers usually think about its efficiency. In embedded programming and system core optimization, appropriate use of bit operations is always a fascinating. When finding a job, it will help you a lot if you use bit operations when writing codes. Mastering simple bit arithmetic skills is necessary. 1. Get maximum int value int getMaxInt(){           return (1 << 31) - 1;//...

   Bit operation, Tips     2012-12-19 12:53:33

  Use cases of Java enumeration

JDK 1.5 introduces a new type -- enumeration. In Java, it's just a small feature, but it can bring us much convenience.Here we summarize some use cases of Java enumeration. 1. Constant Prior to JDK 1.5, we can define constant as public static final..., now we can use enumeration to group all constants in one enum variable and it also provides some useful functions. public enum Color {     RED, GREEN, BLANK, YELLOW   }  2.In Swit...

   Java, Enum,enumeration     2013-01-05 09:15:30

  When will Google be back to China?

There will be news about Google returning back to China every now and then since the search giant left China in 2010. Every sign of change about Google in China will give people big hope on its return. But Chinese are still waiting for the dream to become true though nothing real happen until now. On Thursday, it seems there is "proof" again that Google is going back to China. In the morning, many Chinese noticed that the official Google China weibo(China's Twitter) account uploaded a photo with...

   GOOGLE,CHINA,SEARCH ENGINE,BAIDU     2017-03-02 09:39:51

  High performance web apps with C++

It is Christmas over here, and it is time of giving. So I decided to give something back to the community. I guess this is as old as web programming itself. Trying to create C++ web framework. If you search on the web, you can find dozen of guys that had exactly the same idea. I am not different. For one of the previous projects(discontinued now) I created simple web framework in C++. If you like to hack in C++, here it is. Code is provided as-is, as part of larger application. You can ex...

   C++,Web apps,Web framework     2012-01-08 10:06:48

  Handle ”cannot modify header information – headers already sent by”

Man PHP developers should encounter ”Warning: Cannot modify header information – headers already sent by ….” error before when executing a PHP script. Here are some solutions to this error. 1. Blank line Check whether there is any blank line after , especially in the files which are used in include() and require(0, some problems are caused by blank lines. 2. Add exit() after head() header (“Location: xxx”); exit(); 3. Use output cache <?php ob_start(); ...

   header sent, PHP error handle     2012-11-17 08:45:22

  The video Twitter is coming

 Last October, Vine was acquired by Twitter before it released. Now Twitter launched this app. Vine only supports 6 seconds video recording, when you tap on the screen, the video recording starts, when you finger leaves the screen, the video recording stops. It can contain a few frames in 6 seconds. You can share the video on Twitter and Facebook. Vine seems like a video version of Instagram because it allows user to record video and share it. It has the same features as Instagram such as L...

   Twitter,Vine,Video Twitter     2013-01-25 05:10:29

  Using MySQL Connector/C++ with Visual Studio 2010

MySQL Connector/C++ is one of the latest connectors for MySQL, developed by Sun Microsystems. The MySQL connector for C++ provides an object-oriented application programming interface (API) and a database driver for connecting C++ applications to the MySQL Server.When we want to build a database application with C++ using Visual Studio 2010, we may use the MySQL Connector/C++, but sometimes we may encounter different errors, either compile or runtime error. After tried many times, I finally made...

   MySQL Connector,C++,Visual Studio 2010,VS2010     2012-06-01 13:52:20

  Fab CEO: Why we choose Tencent in China?

Today one important news is that Fab completes its D round fund raising with 150 million US dollars. Regarding this round of fund raising, Fab CEO Jason Goldberg explained : "If Fab wants to do business in US only, then it's not necessary to raise so much money.". Also from the investment of Tencent and Itochu from Japan, China and Japan will be Fab's new market of expansion. Why does Fab choose to cooperate with Tencent to expand Chinese market?(There was news that Alibaba was also contacting F...

   Fab,Tencent,Alibaba     2013-06-19 03:05:03

  Content based HTTP Cache

Browsers may cache the webpages we visited, when user types a URL on the address bar, the browser may cache the webpage returned from server while displaying it. If there is no update on the webpage, then next time when the browser requests the same page, it will not download the page again, instead it will load the cached page. If the website explicitly specify that the page is updated, then the browser will download the page again from the server. What's HTTP Cache? You may be familiar with th...

   HTTP Cache,Web crawler     2013-05-24 05:12:59

  PHP advisory file lock : flock

When we process a file in PHP, we may often need to acquire a lock so that other scripts cannot edit the same file at the same time. There is a flock() function in PHP which can help us lock the file we want to process. But there is one issue we should take care. Recently, ffb encountered one issue while he was trying to lock a file handle. The codes are below: $filename = "/tmp/lock.txt";      $fp = fopen($filename, "r+");   if (!$fp...

   flock(),advisory locking,PHP     2013-04-23 11:42:48